bin=main
src=main.cpp
proto_file=contacts.proto
proto_cc=contacts.pb.cc
import_path=.
dst_dir=.

$(bin):$(src) $(proto_cc)
	g++ $^ -o $@ -std=c++11 -lprotobuf

.PHONY:run, clean, proto_clean, proto_create
run:
	./$(bin)
clean:
	rm -f $(bin)
proto_clean:
	rm -f $(obj_file)*
proto_create:
	protoc --proto_path=$(import_path) --cpp_out=$(dst_dir) $(proto_file)